<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<jsp:include page="../header.jsp" />

<table>
	<c:forEach items="${listOfAllPosts}" var="post">

		<tr>
			<td style="min-width: 50px;">[${post.getId()}]</td>
			<td style="min-width: 220px;">Od <b>${post.getSourcePerson().getName()} ${post.getSourcePerson().getSurname()}</b></td>
			<td style="min-width: 220px;">Do <b>${post.getDestinationPerson().getName()} ${post.getDestinationPerson().getSurname()}</b></td>
			<td style="min-width: 100px;">${post.getCreatedDateString()}</td>
		</tr>
		<tr>
			<td colspan="4">${post.getPostContent()}</td>
		</tr>
		<tr>
			<td colspan="4" align="right"><a href="adminListOfPosts.html?del=${post.getId()}">Usuń</a></td>
		</tr>
		<tr style="min-height: 300px">
			<td colspan="4"><hr></td>
		</tr>

	</c:forEach>
</table>

<jsp:include page="../footer.jsp" />